package com.example.denglu.util;

import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author xiejunwei
 * @create 2021-09-22 14:46
 */
public class ParamsUtils {

    public static List<String> stringToList(String keyWord) {
        if (StringUtils.isNotBlank(keyWord)) {
            String[] keyWords = keyWord.split(" ");
            return Arrays.stream(keyWords).filter(StringUtils::isNotBlank).collect(Collectors.toList());
        }
        return new ArrayList<>();
    }
}
